package com.xiaodimall.backsys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: CJJ
 * @Date: Created in 2022/11/25 18:37
 * @Description:
 */
@Controller
@RequestMapping("/admin/to")
public class AdminPageController {

    /**
     * @Author: CJJ
     * 页面跳转
     * @return 首页视图
     */
    @GetMapping("/index")
    public String toAdmin(){
        return "/admin/index";
    }

    /**
     * @Author: CJJ
     * 页面跳转
     * @return 所有商品视图
     */
    @GetMapping("/goods")
    public String toAllGoods(){
        return "admin/goods-list";
    }


    @GetMapping("/{pageName}")
    public String toAdmin(@PathVariable("pageName") String pageName){
        return "/admin/" + pageName;
    }
}
